Skip to content

Apply buildQueryKey across entire library for object data parity#1596

Open
JonnyWong16 wants to merge 3 commits intopushingkarmaorg:masterfrom
JonnyWong16:feature/buildQueryKey
Open

Apply buildQueryKey across entire library for object data parity#1596
JonnyWong16 wants to merge 3 commits intopushingkarmaorg:masterfrom
JonnyWong16:feature/buildQueryKey

Conversation

@JonnyWong16
Copy link
Collaborator

Description

Apply the _buildQueryKey function from #1593 across the entire PlexAPI library to ensure data parity in all object responses.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

Copilot AI review requested due to automatic review settings March 22, 2026 23:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands usage of the shared _buildQueryKey helper across PlexAPI object-fetching methods to consistently include includeGuids and other query params, improving response parity for partial/related object lookups.

Changes:

  • Replaced hand-built query strings (and some plain keys) with _buildQueryKey(...) across video/audio/photo/playlist/library/collection/mixins.
  • Updated PlexObject._buildQueryKey to correctly append parameters when the input key already contains an existing query string (?).
  • Standardized a few fetch patterns by building the key first, then calling fetchItem/fetchItems.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
plexapi/base.py Fixes _buildQueryKey to merge params with keys that already contain ?.
plexapi/library.py Applies _buildQueryKey to hubs/onDeck/recentlyAdded/search/tag/filter fetches.
plexapi/video.py Applies _buildQueryKey to onDeck and parent/grandparent fetches for show/season/episode relations.
plexapi/audio.py Applies _buildQueryKey to nearest/allLeaves/parent relations and station fetches.
plexapi/photo.py Applies _buildQueryKey to children/parent lookups for albums/photos/clips.
plexapi/playlist.py Applies _buildQueryKey to playlist item retrieval endpoint.
plexapi/collection.py Applies _buildQueryKey to collection children retrieval.
plexapi/mixins/objects.py Applies _buildQueryKey to extras and related hubs mixins.
plexapi/media.py Applies _buildQueryKey to media tag items() retrieval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants